## OVERVIEW

this folder contains the replication materials for 'The Comparative Meaning of Political Space: A Comprehensive Modeling Approach' by garret binding, jelle koedam, and marco steenbergen.

please cite the published article when utilizing these files.

## R SCRIPTS

00_full.R is a wrapper function that calls all individual scripts in the correct order so that no further manual intervention is necessary.

01_run_models.R estimates the models.

02_write_out.R reduces this output to the main quantities of interest.

03_main.R generates the figures and tables used in the paper.

documentation of code working is written to log.txt.

this code is executed on a pc running Ubuntu 20.04.3 LTS with 8cpu and 32gb ram.

## R DATA

the datasets used for this analysis are available via https://www.chesdata.eu/, the versions we used are referenced when loading the data.

the datasets should be saved in the same working directory as the scripts are contained in, in a folder named /data.

## R PACKAGES

the r packages used to run this analysis are specified below.

# sessionInfo()
# R version 4.1.1 (2021-08-10)
# Platform: x86_64-pc-linux-gnu (64-bit)
# Running under: Ubuntu 20.04.3 LTS
# 
# Matrix products: default
# BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
# LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
# 
# locale:
#   [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8        LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8    LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
# [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
# 
# attached base packages:
#   [1] stats     graphics  grDevices utils     datasets  methods   base     
# 
# other attached packages:
#   [1] ggrepel_0.9.1   readxl_1.3.1    Rvoteview_0.1   abind_1.4-5     posterior_1.1.0 bayesplot_1.8.1 cmdstanr_0.4.0  xml2_1.3.2      rvest_1.0.2     devtools_2.4.2  usethis_2.1.0   forcats_0.5.1   stringr_1.4.0  
# [14] purrr_0.3.4     readr_2.0.2     tibble_3.1.5    ggplot2_3.3.5   tidyverse_1.3.1 loo_2.4.1       tidyr_1.1.4     dplyr_1.0.7    
# 
# loaded via a namespace (and not attached):
#   [1] matrixStats_0.61.0   fs_1.5.0             lubridate_1.8.0      httr_1.4.2           rprojroot_2.0.2      rstan_2.21.2         tensorA_0.36.2       tools_4.1.1          backports_1.2.1      utf8_1.2.2          
# [11] R6_2.5.1             DBI_1.1.1            colorspace_2.0-2     withr_2.4.2          tidyselect_1.1.1     gridExtra_2.3        prettyunits_1.1.1    processx_3.5.2       curl_4.3.2           compiler_4.1.1      
# [21] cli_3.0.1            desc_1.4.0           scales_1.1.1         checkmate_2.0.0      ggridges_0.5.3       callr_3.7.0          StanHeaders_2.21.0-7 pscl_1.5.5           pkgconfig_2.0.3      sessioninfo_1.1.1   
# [31] dbplyr_2.1.1         fastmap_1.1.0        rlang_0.4.11         rstudioapi_0.13      generics_0.1.0       farver_2.1.0         jsonlite_1.7.2       distributional_0.2.2 inline_0.3.19        magrittr_2.0.1      
# [41] Rcpp_1.0.7           munsell_0.5.0        fansi_0.5.0          lifecycle_1.0.1      stringi_1.7.5        MASS_7.3-54          pkgbuild_1.2.0       plyr_1.8.6           grid_4.1.1           parallel_4.1.1      
# [51] crayon_1.4.1         haven_2.4.3          hms_1.1.1            knitr_1.36           ps_1.6.0             pillar_1.6.3         codetools_0.2-18     stats4_4.1.1         pkgload_1.2.3        fastmatch_1.1-3     
# [61] reprex_2.0.1         glue_1.4.2           V8_3.4.2             remotes_2.4.1        RcppParallel_5.1.4   modelr_0.1.8         vctrs_0.3.8          tzdb_0.1.2           testthat_3.1.0       cellranger_1.1.0    
# [71] gtable_0.3.0         assertthat_0.2.1     cachem_1.0.6         xfun_0.26            broom_0.7.9          rstiefel_1.0.1       memoise_2.0.0        ellipsis_0.3.2      